<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="CSSStyleDeclaration,mx.styles.CSSStyleDeclaration,defaultFactory,factory,overrides,clearStyle,getStyle,setStyle" name="keywords">
<title>mx.styles.CSSStyleDeclaration</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'CSSStyleDeclaration - Zentrum virtUOS: virtPresenter';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">virtPresenter AsDoc</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mx/styles/CSSStyleDeclaration.html&amp;mx/styles/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;CSSStyleDeclaration</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class CSSStyleDeclaration"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.styles</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class CSSStyleDeclaration</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">CSSStyleDeclaration <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p>
  The CSSStyleDeclaration class represents a set of CSS style rules.
  The MXML compiler automatically generates one CSSStyleDeclaration object
  for each selector in the CSS files associated with a Flex application.
  
  <p>A CSS rule such as
  <pre>
      Button { color: #FF0000 }
  </pre>
  affects every instance of the Button class;
  a selector like <code>Button</code> is called a type selector
  and must not start with a dot.</p>
   <p>A CSS rule such as
  <pre>
      .redButton { color: #FF0000 }
  </pre>
  affects only components whose <code>styleName</code> property
  is set to <code>".redButton"</code>;
  a selector like <code>.redButton</code> is called a class selector
  and must start with a dot.</p>
   <p>You can access the autogenerated CSSStyleDeclaration objects
  using the <code>StyleManager.getStyleDeclaration()</code> method,
  passing it either a type selector
  <pre>
  var buttonDeclaration:CSSStyleDeclaration =
      StyleManager.getStyleDeclaration("Button");
  </pre>
  or a class selector
  <pre>
  var redButtonStyleDeclaration:CSSStyleDeclaration =
      StyleManager.getStyleDeclaration(".redButton");
  </pre>
  </p>
   <p>You can use the <code>getStyle()</code>, <code>setStyle()</code>,
  and <code>clearStyle()</code> methods to get, set, and clear 
  style properties on a CSSStyleDeclaration.</p>
   <p>You can also create and install a CSSStyleDeclaration at run time
  using the <code>StyleManager.setStyleDeclaration()</code> method:
  <pre>
  var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration();
  newStyleDeclaration.defaultFactory = function():void
  {
      leftMargin = 50;
      rightMargin = 50;
  }
  StyleManager.setStyleDeclaration(".bigMargins", newStyleDeclaration, true);
  </pre>
  </p>
   <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="../core/UIComponent.html" target="">mx.core.UIComponent</a>
<br>
<a href="../styles/StyleManager.html" target="">mx.styles.StyleManager</a>
</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#defaultFactory">defaultFactory</a> : Function<div class="summaryTableDescription">
      This function, if it isn't <code>null</code>,
      is usually autogenerated by the MXML compiler.</div>
</td><td class="summaryTableOwnerCol">CSSStyleDeclaration</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#factory">factory</a> : Function<div class="summaryTableDescription">
      This function, if it isn't <code>null</code>,
      is usually autogenerated by the MXML compiler.</div>
</td><td class="summaryTableOwnerCol">CSSStyleDeclaration</td>
</tr>
</table>
</div>
<a name="protectedPropertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Properties</div>
<table id="summaryTableProtectedProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#overrides">overrides</a> : Object<div class="summaryTableDescription">
      If the <code>setStyle()</code> method is called on a UIComponent or CSSStyleDeclaration
      at run time, this object stores the name/value pairs that were set;
      they override the name/value pairs in the objects produced by
      the  methods specified by the <code>defaultFactory</code> and 
      <code>factory</code> properties.</div>
</td><td class="summaryTableOwnerCol">CSSStyleDeclaration</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#CSSStyleDeclaration()">CSSStyleDeclaration</a>(selector:String = null)</div>
<div class="summaryTableDescription">
      Constructor.</div>
</td><td class="summaryTableOwnerCol">CSSStyleDeclaration</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clearStyle()">clearStyle</a>(styleProp:String):void</div>
<div class="summaryTableDescription">
      Clears a style property on this CSSStyleDeclaration.</div>
</td><td class="summaryTableOwnerCol">CSSStyleDeclaration</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getStyle()">getStyle</a>(styleProp:String):*</div>
<div class="summaryTableDescription">
      Gets the value for a specified style property,
      as determined solely by this CSSStyleDeclaration.</div>
</td><td class="summaryTableOwnerCol">CSSStyleDeclaration</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setStyle()">setStyle</a>(styleProp:String, newValue:*):void</div>
<div class="summaryTableDescription">
      Sets a style property on this CSSStyleDeclaration.</div>
</td><td class="summaryTableOwnerCol">CSSStyleDeclaration</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="defaultFactory"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">defaultFactory</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var defaultFactory:Function</code><p>
      This function, if it isn't <code>null</code>,
      is usually autogenerated by the MXML compiler.
      It produce copies of a plain Object, such as
      <code>{ leftMargin: 10, rightMargin: 10 }</code>,
      containing name/value pairs for style properties; the object is used
      to build a node of the prototype chain for looking up style properties.
           </p><p>If this CSSStyleDeclaration is owned by a UIComponent
      written in MXML, this function encodes the style attributes
      that were specified on the root tag of the component definition.</p>
           <p>If the UIComponent was written in ActionScript,
      this property is <code>null</code>.</p>
     </div>
<a name="factory"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">factory</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var factory:Function</code><p>
      This function, if it isn't <code>null</code>,
      is usually autogenerated by the MXML compiler.
      It produce copies of a plain Object, such as
      <code>{ leftMargin: 10, rightMargin: 10 }</code>,
      containing name/value pairs for style properties; the object is used
      to build a node of the prototype chain for looking up style properties.
           </p><p>If this CSSStyleDeclaration is owned by a UIComponent,
      this function encodes the style attributes that were specified in MXML
      for an instance of that component.</p>
     </div>
<a name="overrides"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">overrides</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var overrides:Object</code><p>
      If the <code>setStyle()</code> method is called on a UIComponent or CSSStyleDeclaration
      at run time, this object stores the name/value pairs that were set;
      they override the name/value pairs in the objects produced by
      the  methods specified by the <code>defaultFactory</code> and 
      <code>factory</code> properties.
     </p></div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="CSSStyleDeclaration()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">CSSStyleDeclaration</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function CSSStyleDeclaration(selector:String = null)</code><p>
      Constructor.
           </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">selector</span>:String</code> (default = <code>null</code>)<code></code> &mdash; If not null, this CSSStyleDeclaration will be
      registered with the StyleManager using the selector value.
     </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="clearStyle()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clearStyle</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function clearStyle(styleProp:String):void</code><p>
      Clears a style property on this CSSStyleDeclaration.
           This is the same as setting the style value to <code>undefined</code>.
           </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">styleProp</span>:String</code> &mdash; The name of the style property.
     </td>
</tr>
</table>
</div>
<a name="getStyle()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getStyle</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getStyle(styleProp:String):*</code><p>
      Gets the value for a specified style property,
      as determined solely by this CSSStyleDeclaration.
           </p><p>The returned value may be of any type.</p>
           <p>The values <code>null</code>, <code>""</code>, <code>false</code>,
      <code>NaN</code>, and <code>0</code> are all valid style values,
      but the value <code>undefined</code> is not; it indicates that
      the specified style is not set on this CSSStyleDeclaration.
      You can use the method <code>StyleManager.isValidStyleValue()</code>
      to test the value that is returned.</p>
           <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">styleProp</span>:String</code> &mdash; The name of the style property.
           </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>*</code> &mdash; The value of the specified style property if set,
      or <code>undefined</code> if not.
     </td>
</tr>
</table>
</div>
<a name="setStyle()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setStyle</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setStyle(styleProp:String, newValue:*):void</code><p>
      Sets a style property on this CSSStyleDeclaration.
           </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">styleProp</span>:String</code> &mdash; The name of the style property.
           </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">newValue</span>:*</code> &mdash; The value of the style property.
      The value may be of any type.
      The values <code>null</code>, <code>""</code>, <code>false</code>,
      <code>NaN</code>, and <code>0</code> are all valid style values,
      but the value <code>undefined</code> is not.
      Setting a style property to the value <code>undefined</code>
      is the same as calling the <code>clearStyle()</code> method.
     </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
